<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>作业1</title>
    <script type="text/javascript">
        window.onload = function(){
            //获取节点
            var GetJD = document.getElementById("city");
            var Lj = document.getElementById("chengDou");
            //新建节点
            var a = document.createElement("li");
            var b = document.createElement("li");
            var c = document.createElement("li");
            //节点文本
            var a1 = document.createTextNode("chongQing");
            var b1 = document.createTextNode("KunMing");
            var c1 = document.createTextNode("广州");
            //对应节点
            a.appendChild(a1);
            b.appendChild(b1);
            c.appendChild(c1);
            //插入节点
            GetJD.insertBefore(a,Lj);
            GetJD.insertBefore(b,Lj.nextSibing);
            GetJD.appendChild(c);
        }
    </script>
</head>
<body>
   <div>
        <p style="color:#00f">旅游城市：</p>
        <ul id="city">
            <li id="bj" name="BeiJing">北京</li>
            <li>上海</li>
            <li id="chengDou">成都</li>
            <li>天津</li>
        </ul>
    </div>
</body>
</html>